package com.lc.admin.task;

import com.lc.admin.bean.Reservation;
import com.lc.admin.mapper.ReservationMapper;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

@Component
public class ReservationStatusTask extends QuartzJobBean {

    @Autowired
    ReservationMapper reservationMapper;
    @Override
    protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
        System.out.println("定时修改过期任务状态...");
        reservationMapper.autoExpire();
    }
}
